package com.lee.bgTask;

import com.lee.bgTask.entity.impl.AbstractTaskEntity;

import java.util.Random;

public class MyTaskEntity extends AbstractTaskEntity {
    @Override
    public void onExcute() {
        Random r = new Random(this.getIndex());
        try {
            Thread.sleep(r.nextInt(500));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(super.getVaribales().get("code"));
    }

    @Override
    public int queueHash() {
        return super.getVaribales().get("code").hashCode();
    }

    @Override
    public String toString() {
        return super.getVaribales().get("code").toString();
    }

}
